refactor!: remove Safety/Shields API and all connected code#5291
refactor!: remove Safety/Shields API and all connected code#5291leseb wants to merge 9 commits intollamastack:mainfrom
Conversation
Remove the deprecated Safety and Shields APIs entirely from llama-stack. This includes: - API packages (llama_stack_api/safety/, llama_stack_api/shields/) - Provider implementations (inline: llama-guard, prompt-guard, code-scanner; remote: bedrock, nvidia, sambanova, passthrough) - Provider registry (providers/registry/safety.py) - Router and routing table (core/routers/safety.py, core/routing_tables/shields.py) - Api enum values (Api.safety, Api.shields) - SafetyConfig, ShieldWithOwner, ShieldsProtocolPrivate from core datatypes - Distribution YAML configs (safety providers, shields registered resources, safety config sections, run-with-safety.yaml files) - Distribution template code (get_shield_registry, default_shields, safety_config) - Agent/responses guardrail execution code (run_guardrails, extract_guardrail_ids, safety_api parameter threading, input/output guardrail checks in streaming) - Telemetry helpers and constants for safety - All safety-related unit and integration tests - ShieldToModerationMixin utility The guardrails parameter in create_openai_response is preserved in the signature but is now a no-op. The Responses API continues to work without safety. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Sébastien Han <seb@redhat.com>
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ llama-stack-client-node studio · conflict
✅ llama-stack-client-go studio · conflict
✅ llama-stack-client-openapi studio · code · diff
✅ llama-stack-client-python studio · conflict
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
|
This pull request has merge conflicts that must be resolved before it can be merged. @leseb please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork |
Signed-off-by: Sébastien Han <seb@redhat.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
Resolve merge conflicts from upstream/main, primarily around the agents-to-responses API rename (PR llamastack#5195) and new upstream changes. The key resolutions were updating Api.agents to Api.responses in datatypes.py and resolver.py, removing reintroduced safety/shields references from OCI and WatsonX distributions, fixing the stainless config to remove safety/shields/moderations endpoints, and regenerating all OpenAPI specs, distribution configs, and coverage documentation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Sébastien Han <seb@redhat.com>
Merge upstream/main into remove-safety-api, resolving conflicts by keeping the safety API removal from this branch. All modify/delete conflicts for safety-related files (shields, safety providers, safety router, safety registry) were resolved by accepting the deletion. Content conflicts in core/datatypes.py, core/stack.py, distributions/template.py, and llama_stack_api/datatypes.py were resolved by removing the safety-related code (ShieldWithOwner, ShieldsProtocolPrivate, validate_safety_config, get_shield_registry) that upstream had modified but this branch intentionally removes. Signed-off-by: Sébastien Han <seb@redhat.com>
|
This pull request has merge conflicts that must be resolved before it can be merged. @leseb please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork |
Accept upstream's updated OpenAI API conformance data including the new Moderations category and updated summary statistics (28/146 endpoints, 87.8% conformance score). These are auto-generated documentation files tracking OpenAI API coverage which are unrelated to the Llama Stack Safety/Shields API removal in this branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Sébastien Han <seb@redhat.com>
The pre-commit hook regenerated conformance data to reflect the actual endpoints available in this branch (27/146 endpoints, 89.0% conformance score) since the Moderations endpoint is not present after the Safety API removal. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Sébastien Han <seb@redhat.com>
- Add "agentic" to tagline per franciscojavierarceo suggestion - Remove Safety/Moderations (being removed in llamastack#5291) - Use uv instead of pip in install instructions - Remove Swift and Kotlin from SDK table - Fix "semantic search" to just "search" for vector stores - Mention non-OpenAI APIs (Prompts, File Processors) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Sébastien Han <seb@redhat.com>
Resolve modify/delete conflicts for dell distribution files that were deleted upstream. Accept the upstream deletion since the dell distribution was removed in main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Sébastien Han <seb@redhat.com>
Summary
Remove the Safety/Shields API and all connected code. Shields are already marked deprecated in the spec. Safety enforcement is better handled at the platform level (guardrails orchestrators, NeMo Guardrails).
What was removed
Stats
Test plan
Signed-off-by: Sebastien Han shan@redhat.com